var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, i) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var i in e)
              Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
          })(e, i);
      };
      return function (e, i) {
        function o() {
          this.constructor = e;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        t(e, i),
          (e.prototype =
            null === i
              ? Object.create(i)
              : ((o.prototype = i.prototype), new o()));
      };
    })(),
  AXStudySkillDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.onLoadXueXiJiNengDataFn = {
          caller: e,
          code: 1396,
          method: function (t) {
            0 == t.code
              ? (ToastView.toastView(t.data),
                WebSocketService.send({ c: 1408, d: { pageNum: 0 } }),
                WebSocketService.send({ c: 1009, d: { id: e.objJson.cid } }))
              : ToastView.toastView(t.msg),
              e.close();
          },
        }),
        e.btn_studySkill.on(Laya.Event.CLICK, e, e.onDidClickStudySkillFn),
        WebSocketService.addListener(e.onLoadXueXiJiNengDataFn),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showStudySkillView = function (t, i) {
        null == this.studyDialog &&
          ((this.studyDialog = new e()), (this.studyDialog.zOrder = 1e3)),
          this.studyDialog.popup(!0),
          (this.studyDialog.objJson = t),
          (this.studyDialog.type = i),
          "xuexi" == i
            ? (this.studyDialog.btn_studySkill.label = "学习技能")
            : "chongxiu" == i &&
              (this.studyDialog.btn_studySkill.label = "重修(2W银)"),
          (this.studyDialog.lable_studyName.text = t.name);
        var o = Utils.transform(Global.roleSex, "roleSexType"),
          l = "";
        t.roleType && (l = (t.roleType % 10) + "");
        var s = Dictionary.roleType[l] + "";
        "男" == o
          ? t.roleType >= 10
            ? "异师" == s
              ? (this.studyDialog.lable_studySkill.text =
                  "血雨腥风、煽风点火\n天打雷劈、毁天灭地")
              : "文人" == s
              ? (this.studyDialog.lable_studySkill.text =
                  "围点打援、隐姓埋名\n乱作一团、金蝉脱壳")
              : "武士" == s &&
                (this.studyDialog.lable_studySkill.text =
                  "舍身取义、坚如磐石\n劈头盖脸、凌波微步")
            : (this.studyDialog.lable_studySkill.text =
                "舍身取义、坚如磐石、劈头盖脸\n血雨腥风、煽风点火、天打雷劈\n围点打援、隐姓埋名、乱作一团")
          : "女" == o &&
            (t.roleType >= 10
              ? "异师" == s
                ? (this.studyDialog.lable_studySkill.text =
                    "血雨腥风、煽风点火\n罪恶毒心、毁天灭地")
                : "文人" == s
                ? (this.studyDialog.lable_studySkill.text =
                    "围点打援、隐姓埋名\n千里冰封、金蝉脱壳")
                : "武士" == s &&
                  (this.studyDialog.lable_studySkill.text =
                    "舍身取义、坚如磐石\n横扫一排、凌波微步")
              : (this.studyDialog.lable_studySkill.text =
                  "舍身取义、坚如磐石、横扫一排\n血雨腥风、煽风点火、罪恶毒心\n围点打援、隐姓埋名、千里冰封"));
      }),
      (e.prototype.onDidClickStudySkillFn = function (t) {
        if ("xuexi" == this.type) {
          (o = this.objJson.cid) || (o = this.objJson.id);
          var e = 1;
          this.objJson.roleType < 10
            ? (e = 1)
            : this.objJson.roleType >= 10 && this.objJson.roleType < 99
            ? (e = 3)
            : this.objJson.roleType >= 100 &&
              this.objJson.roleType < 999 &&
              (e = 4);
          Utils.transform(this.objJson.roleType, "roleType");
          WebSocketService.send({
            c: 1396,
            d: { cid: o, action: e, skillid: 0 },
          });
        } else if ("chongxiu" == this.type) {
          var i = this.objJson.skillId;
          void 0 == i && (i = this.objJson.id);
          var o = this.objJson.cid;
          this.objJson.roleType >= 10
            ? WebSocketService.send({
                c: 1396,
                d: { cid: o, action: 5, skillid: i },
              })
            : WebSocketService.send({
                c: 1396,
                d: { cid: o, action: 2, skillid: 0 },
              });
        }
      }),
      (e.close = function () {
        this.studyDialog && this.studyDialog.close();
      }),
      e
    );
  })(ui.SubSquareController.AXStudySkillDialogUI);
